#include "fxcc/yml/Serializer.h"

using namespace fxcc::yml;

template <>
void Serializer::Encode<float>(YAML::Node& node, const float& inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<float>(const YAML::Node& node, float& inst)
{
    inst = node.as<float>();
    return true;
}

template <>
void Serializer::Encode<double>(YAML::Node &node, const double &inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<double>(const YAML::Node &node, double &inst)
{
    inst = node.as<double>();
    return true;
}

template <>
void Serializer::Encode<bool>(YAML::Node &node, const bool &inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<bool>(const YAML::Node &node, bool &inst)
{
    inst = node.as<bool>();
    return true;
}

template <>
void Serializer::Encode<int>(YAML::Node &node, const int &inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<int>(const YAML::Node &node, int &inst)
{
    inst = node.as<int>();
    return true;
}

template <>
void Serializer::Encode<uint64_t>(YAML::Node& node, const uint64_t& inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<uint64_t>(const YAML::Node& node, uint64_t& inst)
{
    inst = node.as<uint64_t>();
    return true;
}
template <>
void Serializer::Encode<unsigned int>(YAML::Node& node, const unsigned int& inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<unsigned int>(const YAML::Node& node, unsigned int& inst)
{
    inst = node.as<unsigned int>();
    return true;
}

template <>
void Serializer::Encode<std::string>(YAML::Node &node, const std::string &inst)
{
    node = inst;
};

template <>
bool Serializer::Decode<std::string>(const YAML::Node &node, std::string &inst)
{
    inst = node.as<std::string>();
    return true;
}
